function accval1 = cal_accuracy(model, data)

N = model.N;
k = model.k;
k_hat = model.k_hat; 
probassgn1 = exp(model.alpha_1)./repmat(sum(exp(model.alpha_1),2),1,k);
probassgn2 = exp(model.alpha_2)./repmat(sum(exp(model.alpha_2),2),1,k_hat);

[indgarbage,ind1]   = max(probassgn1');
[indgarbage,ind2]   = max(probassgn2');

A=find(data.truelabel==ind1');

accval1 = 100*size(A,1)/size(data.truelabel,1);
accval2 = 100*calculateAccuracy(data.truelabel', ind2);

end
